//
//  AFNetworkConstant.h
//  AFNetworkTool
//
//  Created by apple on 2017/9/12.
//  Copyright © 2017年 Apple. All rights reserved.
//

#ifndef AFNetworkConstant_h
#define AFNetworkConstant_h


#if DEBUG

#define LZBLog(fmt,...) NSLog(@"%s[Lind %d]:" fmt, __PRETTY_FUNCTION__,__LINE__, ##__VA_ARGS__)

#else

#define LZBLog(...)

#endif

#define LZB_suppressPerformSelectorLeakWarning(Stuff) \
do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
Stuff; \
_Pragma("clang diagnostic pop") \
} while (0)


/**
 请求方式
 */
typedef NS_ENUM(NSInteger, AFNetworkRequestMethod) {
    AFNetworkRequestMethod_GET = 0,
    AFNetworkRequestMethod_POST = 1,
    AFNetworkRequestMethod_HEAD = 2,
    AFNetworkRequestMethod_PUT = 3,
    AFNetworkRequestMethod_DELETE = 4,
    AFNetworkRequestMethod_PATCH = 5,
};

/**
 请求序列化类型
 */
typedef NS_ENUM(NSInteger , AFNetworkRequestSerializerType) {
    /**HTTP*/
    AFNetworkRequestSerializerType_HTTP = 0,
    /**JSON*/
    AFNetworkRequestSerializerType_JSON,
};


/**
 响应系列化类型
 */
typedef NS_ENUM(NSInteger, AFNetworkResponseSerializerType) {
    /// NSData type
    AFNetworkResponseSerializerType_HTTP = 0,
    /// JSON object type
    AFNetworkResponseSerializerType_JSON = 1,
    /// NSXMLParser type
    AFNetworkResponseSerializerType_XMLParser = 2,
};



#pragma mark - 错误表

//请求未连接的失败
#define AFNETWORK_NOT_LINK_ERROR_CODE 6666
//序列化失败
#define AFNETWORK_RESPONSE_SERIALIZER_ERROR_CODE 7777






#pragma mark - 默认文字对照表
#define AFNETWORK_DEFAULT_FAIL_MESSAGE @"服务器努力抢救中，请稍后再试"
#define AFNETWORK_SERIALIZER_FAIL_MESSAGE @"服务器解析失败"

#endif /* AFNetworkConstant_h */
